1. Field of the Invention
The present invention relates to a run length encoder for compressing binary image data and restoring compressed image data.
2. Description of Related Art
A one dimensional encoding method such as modified Hoffman encoding method is widely used for compressing binary image data including black and white picture elements efficiently in the image data processing system such as the facsimile system.
According to the encoding method, an encoding code is assigned to every one dimensional black or white run length. Upon assigning codes, an encoding code having a shorter code length is assigned to a run length having a higher statistical probability of occurrence in a normal document in order to increase the compressing rate of image data. Namely, in a normal document of a white ground, the shortest code is assigned to a run length of two or three unit lengths. This type of encoding is referred to in the present specification and claims as "run length encoding."
However, in the microfilm system, microfilms of negative image type are usually used than those of positive image type. In such a microfilm of negative image type, statistical properties of black and white run lengths are inverted with each other. Accordingly, if an image of negative image type is processed with use of the conventional encoding method, the compression efficiency is rather worsened since long codes are assigned to run lengths each of which occurs at a high probability in the image of negative type.